<?php
$this->pageTitle=Yii::app()->name . ' - Поиск';
$this->breadcrumbs=array(
	'Поиск',
);
?>

<h1>Поиск: <?php echo isset($_GET['search']) ? $_GET['search'] : ''?></h1>
<hr/>

<div class="search_result">
	<?php if(isset($model) && $model!=NULL): ?>
		<ol>
		<?php foreach ($model as $key => $value): ?>
			<?php 
			switch($value['t']){
				case 'documentSituations':
					$url = Yii::app()->createUrl($value['t'].'/view', array('id' => $value['id'], 'name'=>$value['title']));
					break;
				case 'post':
				case 'category':
					$url = Yii::app()->createUrl($value['t'].'/view', array('id' => $value['id'], 'title'=>$value['title']));
					break;
				default:
					$url = Yii::app()->createUrl($value['t'].'/view', array('id' => $value['id']));
			}
			?>
			<li>
				<b><?php echo $value['r']; ?>:</b> <a href="<?php echo $url;?>"><?php echo $value['title']; ?></a>
			</li>
		<?php endforeach; ?>
		</ol>
	<?php else: ?>
	<p>Нет результатов.</p>
	<?php endif; ?>
</div>

